x86/cpuid: Avoid unconditionally clobbering ITSC for guests
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 13 May 2016 18:38:41 +0000 (19:38 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 May 2016 14:54:49 +0000 (15:54 +0100)
commita5adcee740df2679cf6828535279d8f8cbe2eff1
tree2a3fede45a6917cb64795aa7db567a35738adcb5
parent9e28baf22ec98a64f68757eff39df72173d5f1bb
x86/cpuid: Avoid unconditionally clobbering ITSC for guests

In general, Invariant TSC is not a feature which can be advertised to guests,
because it cannot be guaranteed across migrate.  domain_cpuid() goes so far as
to deliberately clobber the feature flag under a number of circumstances.

Because ITSC is absent from the static {pv,hvm}_featureset masks, c/s b648feff
"xen/x86: Improvements to in-hypervisor cpuid sanity checks" caused ITSC to be
unconditionally masked out.

As an interim solution, include the hosts idea of ITSC along with the static
{pv,hvm}_featureset when restricting the guests view of features.  This causes
the hardware domain, and VMs explicitly configured with ITSC and no-migrate to
be offered ITSC (subject to hardware availability).

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <JBeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/traps.c